#include "timeseparatoritem.h"

#include <QLabel>
#include <QHBoxLayout>
#include <QFrame>

TimeSeparatorItem::TimeSeparatorItem(const QString &timeText, QWidget *parent)
    : QWidget(parent)
{
    auto *root = new QHBoxLayout(this);
    root->setContentsMargins(0, 4, 0, 4);

    auto *frame = new QFrame(this);
    frame->setStyleSheet("QFrame{ background:transparent; } QLabel{ color:#444444; }");

    auto *inner = new QHBoxLayout(frame);
    inner->setContentsMargins(8, 2, 8, 2);
    auto *label = new QLabel(timeText, frame);
    QFont f = label->font();
    f.setPointSize(std::max(8, f.pointSize()-2));
    label->setFont(f);
    inner->addWidget(label, 0, Qt::AlignCenter);

    root->addStretch();
    root->addWidget(frame, 0, Qt::AlignCenter);
    root->addStretch();
}


